.rayui-slider {
  --slider-height: 10px;
  --slider-top-position: 0;
  --range-width: 20px;
  --range-left-position: 20px;
  --thumb-height: 24px;
  --thumb-width: 24px;
  --thumb-left-position: 30px;
  --thumb-active-color: #ffffff;

  border-radius: 5px;
  background: #e0e0e0;
  height: var(--slider-height);
  margin: var(--slider-top-position);
  position: relative;
  display: flex;
  align-items: center;

  &-steps {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    &-dot {
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background-color: #328eff;
      &:first-child {
        opacity: 0;
      }
      &:last-child {
        opacity: 0;
      }
    }
  }

  &-bar {
    display: none;
    position: absolute;
    width: var(--range-width);
    height: var(--slider-height);
    background: #328eff;
    cursor: pointer;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    flex-shrink: 0;
    will-change: width;
    overflow: hidden;
    .rayui-slider-steps-dot {
      background-color: rgba(51, 255, 241, 0.75);
    }
    &-text {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      display: inline-block;
      font-size: 12px;
      color: #fff;
      white-space: nowrap;
    }

    &-steps_wrap {
      position: absolute;
      pointer-events: none;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
  }

  &-thumb {
    position: absolute;
    will-change: left;
    display: none;

    &-start {
      top: 50%;
      transform: translateY(-50%);
      display: none;
      &-render {
        width: var(--thumb-width);
        height: var(--thumb-height);
        border-radius: 50%;
        background: var(--thumb-active-color);
        cursor: pointer;
        box-shadow: rgb(0 0 0 / 12%) 0px 0.5px 4px, rgb(0 0 0 / 12%) 0px 6px 13px;
      }
    }
    &-end {
      top: 50%;
      transform: translateY(-50%);
      display: none;
      &-render {
        width: var(--thumb-width);
        height: var(--thumb-height);
        border-radius: 50%;
        background: var(--thumb-active-color);
        cursor: pointer;
        box-shadow: rgb(0 0 0 / 12%) 0px 0.5px 4px, rgb(0 0 0 / 12%) 0px 6px 13px;
        align-items: center;
        justify-content: center;
        display: flex;
      }
    }
  }

  &.reverse {
    .rayui-slider {
      &-bar {
        right: 0;
        left: auto;
        border-top-right-radius: 5px;
        border-bottom-right-radius: 5px;
      }
    }
  }

  &.vertical {
    --slider-width: 300px;
    width: var(--slider-height);
    height: var(--slider-width);
    align-items: flex-start;
    justify-content: center;

    .rayui-slider {
      &-steps {
        height: 100%;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: column;
        align-items: center;
      }
      &-bar {
        height: var(--range-width);
        width: var(--slider-height);
        top: calc(var(--range-left-position) + var(--thumb-width) / 2);
        border-top-right-radius: 5px;
        border-bottom-right-radius: 5px;
        transform: translateX(-50%);
        left: 50%;
        will-change: height;
      }
      &-thumb {
        will-change: top;
        &-start {
          left: 50%;
          transform: translateX(-50%);
        }
        &-end {
          left: 50%;
          transform: translateX(-50%);
        }
      }
    }
  }

  &.vertical.reverse {
    .rayui-slider {
      &-bar {
        top: auto;
        bottom: 0;
      }
    }
  }

  &.disabled {
    pointer-events: none;
  }
}

.rayui-slider_wrap {
  border-radius: 5px;
  &.vertical {
    padding: 0 20rpx;
    display: inline-block;
  }
}
